package com.javasm.myexception;

import com.javasm.http.AjaxRespEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 自定义异常处理类
 */
@ControllerAdvice
public class MyExceptionHandle {

    @ExceptionHandler(MyException.class)
    public AjaxRespEntity handle(MyException myException) {
        return AjaxRespEntity.selfOperate(myException.getAjaxMsgEnum());
    }


}
